package com.glorious.entities;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * 客户端信息
 */
@Data
public class OauthClientDetails implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @TableId(type = IdType.INPUT)
    @ApiModelProperty(value = "客户端ID")
    @Column(columnDefinition = "varchar(255) NOT NULL COMMENT '客户端ID'")
    private String clientId;

    @ApiModelProperty(value = "客户端密钥")
    @Column(columnDefinition = "varchar(255) COMMENT '客户端密钥'")
    private String clientSecret;

    @ApiModelProperty(value = "资源id列表")
    @Column(columnDefinition = "varchar(255) COMMENT '资源id列表'")
    private String resourceIds;

    @ApiModelProperty(value = "域")
    @Column(columnDefinition = "varchar(255) COMMENT '域'")
    private String scope;

    @ApiModelProperty(value = "授权方式")
    @Column(columnDefinition = "varchar(255) COMMENT '授权方式'")
    private String authorizedGrantTypes;

    @ApiModelProperty("回调地址")
    @Column(columnDefinition = "varchar(255) COMMENT '回调地址'")
    private String webServerRedirectUri;

    @ApiModelProperty(value = "权限列表")
    @Column(columnDefinition = "varchar(255) COMMENT '权限列表'")
    private String authorities;

    @ApiModelProperty(value = "认证令牌时效")
    @Column(columnDefinition = "int(11) COMMENT '认证令牌时效'")
    private Integer accessTokenValidity;

    @ApiModelProperty(value = "刷新令牌时效")
    @Column(columnDefinition = "int(11) COMMENT '刷新令牌时效'")
    private Integer refreshTokenValidity;

    @ApiModelProperty(value = "扩展信息")
    @Column(columnDefinition = "varchar(255) COMMENT '扩展信息'")
    private String additionalInformation;

    @ApiModelProperty(value = "是否自动放行")
    @Column(name = "autoapprove", columnDefinition = "varchar(255) COMMENT '是否自动放行'")
    private String autoapprove;
}
